package com.test.nio;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;

import java.net.InetSocketAddress;
import java.net.Socket;
import java.util.Scanner;

@Slf4j
@Data
public class Client {
    public static void main(String[] args) throws Exception {
        Socket socket = new Socket();
        socket.connect(new InetSocketAddress("localhost", 8081));

        Scanner input =new Scanner(System.in);
        while (input.hasNext()) {
            String s=input.next();
            socket.getOutputStream().write(s.getBytes());
        }


    }


}
